#!/bin/sh

export CFLG="-D___SYS_I486 -D___OS_LIN"
export GFLG="-D___GUI"
export IFLG="-I. -Ilib"

if [ "$1" == "-g" ]; then
  export CFLG="$CFLG $GFLG"
  shift
fi
if [ "$1" == "-x" ]; then
  export CFLG="$CFLG -D___DLLIMP"
  shift
fi
if [ "$1" == "-ropt" ]; then
  export CFLG="$CFLG -D___ROPT"
  shift
fi
if [ "$1" == "" ]; then
  echo "Args: [-g] [-x] [-ropt] <name>"
  exit 0
fi
export NAM=$1
shift

echo CFLG=$CFLG
gcc -s -O2 -Wall -c $CFLG $IFLG $NAM.c
